<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <!--    导入自己的css文件-->
    <link rel="stylesheet" href="../css/my-css.css">
    <style>
        .el-main {
            width: 1200px;
            margin: 0 auto;
        }

        .reg_form {
            width: 375px;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>
        <my-header></my-header>
        <el-main style="margin-top: 30px">
            <el-carousel :interval="2000" type="card" height="375px">
                <el-carousel-item v-for="banner in bannerArr">
                    <img :src="banner.imgUrl" width="100%">
                </el-carousel-item>
            </el-carousel>
        </el-main>
        <my-footer></my-footer>
    </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<!--引入axios框架文件-->
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
<!--导入自己的头部js文件-->
<script src="../js/my-header.js"></script>
<!--导入自己的尾部js文件-->
<script src="../js/my-footer.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function () {
            return {
                bannerArr: []
            }
        },
        methods: {},
        created() {
            axios.get("/v1/banners/selectAllBanner").then(response => {
                if (response.data.code == 20000) {
                    v.bannerArr = response.data.data;
                }
            })
        }
    })
</script>
</html>